<!--
 * @Description: 添加邀请助力商品或优惠券
 * @Author: Li Yujie
 * @Date: 2021/02/02
 * @Last Modified by: Li Yujie
 * @Last Modified time: 2021/02/02
-->
<template>
    <div class="wrapper">
        <div class="content-wrapper">
            <!-- header -->
            <div class="header">
                <div class="header-title">
                    {{ type === 'add' ? '添加内容' : '编辑内容' }}
                </div>
            </div>
            <!-- /header -->
            <el-tabs
                v-model="ruleForm.type"
                @tab-click="$refs.ruleForm.clearValidate()"
            >
                <el-tab-pane
                    label="添加商品"
                    name="1"
                    :disabled="type === 'edit'"
                />
                <el-tab-pane
                    label="添加优惠券"
                    name="2"
                    :disabled="type === 'edit'"
                />
                <el-tab-pane
                    label="添加红包"
                    name="3"
                    :disabled="type === 'edit'"
                />
            </el-tabs>
            <!--表单-->
            <el-form
                :model="ruleForm"
                :rules="rules"
                label-position="right"
                ref="ruleForm"
                label-width="140px"
                class="form-wrap"
            >
                <!-- 选择商品 -->
                <template v-if="ruleForm.type === '1'">
                    <el-form-item
                        label="选择自营商品"
                        prop="goods_no"
                    >
                        <div class="select-goods-view">
                            <template v-if="type === 'add'">
                                <div
                                    class="select-goods"
                                    v-if="!ruleForm.goods_no"
                                    @click="$refs.goodsSelect.show(1,requestUrl, typeList)"
                                >
                                    <i class="el-icon-plus"/>
                                    <div>点击选择商品</div>
                                </div>
                                <div
                                    class="select-goods selected"
                                    v-else
                                    @click="$refs.goodsSelect.show(1,requestUrl, typeList)"
                                >
                                    <el-image :src="goods_cover">
                                        <div
                                            slot="error"
                                            class="image-slot"
                                        >
                                            <i class="el-icon-picture-outline"/>
                                        </div>
                                    </el-image>
                                </div>
                            </template>
                            <template v-else>
                                <div class="select-goods detail">
                                    <el-image :src="goods_cover">
                                        <div
                                            slot="error"
                                            class="image-slot"
                                        >
                                            <i class="el-icon-picture-outline"/>
                                        </div>
                                    </el-image>
                                </div>
                            </template>
                            <div class="select-goods-info">
                                <div class="goods-info-item">
                                    <div class="goods-info__label">商品名称：</div>
                                    <div class="goods-info__value">{{ goods_title ? goods_title : '--' }}</div>
                                </div>
                                <div class="goods-info-item">
                                    <div class="goods-info__label">商品ID：</div>
                                    <div class="goods-info__value">{{ ruleForm.goods_no ? ruleForm.goods_no : '--' }}</div>
                                </div>
                                <div class="goods-info-item">
                                    <div class="goods-info__label">商品原价：</div>
                                    <div class="goods-info__value">{{ goods_price ? `￥${goods_price}` : '--' }}</div>
                                </div>
                            </div>
                        </div>
                    </el-form-item>
                </template>
                <!-- 选择优惠券 -->
                <template v-if="type === 'add' && ruleForm.type === '2'">
                    <el-form-item
                        label="选择优惠券"
                        prop="coupon_no"
                    >
                        <div
                            class="select-btn"
                            @click="$refs.couponSelect.show('coupon_nos')"
                        >
                            {{ ruleForm.coupon_no ? '重新选择' : '选择优惠券' }}
                        </div>
                    </el-form-item>
                </template>
                <!-- 选择红包 -->
                <template v-if="type === 'add' && ruleForm.type === '3'">
                    <el-form-item
                        label="选择红包"
                        prop="packet_no"
                    >
                        <div
                            class="select-btn"
                            @click="$refs.packetSelect.show()"
                        >
                            {{ ruleForm.packet_no ? '重新选择' : '选择红包' }}
                        </div>
                    </el-form-item>
                </template>

                <el-form-item
                    label="助力价&库存设置"
                    v-if="ruleForm.type === '1'"
                >
                    <el-table
                        :data="ruleForm.price_list"
                        empty-text="暂无数据，请先选择商品"
                        class="data-table product"
                        @selection-change="handleSelectAll($event)"
                    >
                        <el-table-column
                            type="selection"
                            align="center"
                            width="48"
                        >
                            <template slot-scope="scope">
                                <el-form-item style="margin-bottom: 20px">
                                    <el-checkbox
                                        v-model="scope.row.check_status"
                                        :true-label="1"
                                        :false-label="0"
                                    />
                                </el-form-item>
                            </template>
                        </el-table-column>
                        <el-table-column
                            label="商品规格"
                            width="240"
                        >
                            <template slot-scope="scope">
                                <el-form-item style="margin-bottom: 20px">
                                    {{ scope.row.spec_list | filterSpec }}
                                </el-form-item>
                            </template>
                        </el-table-column>
                        <el-table-column
                            label="原售价"
                            align="center"
                        >
                            <template slot-scope="scope">
                                <el-form-item style="margin-bottom: 20px">
                                    {{ scope.row.product_price }}
                                </el-form-item>
                            </template>
                        </el-table-column>
                        <el-table-column
                            prop="product_price"
                            label="邀请助力价"
                        >
                            <template slot-scope="scope">
                                <el-form-item style="margin-bottom: 20px">
                                    <el-input
                                        v-model="scope.row.price"
                                        placeholder="请输入邀请助力价"
                                        size="medium"
                                        style="width: 166px"
                                        :disabled="scope.row.check_status === 0"
                                        @click.native="clickDisableInput(scope.row)"
                                    />
                                </el-form-item>
                            </template>
                        </el-table-column>
                        <el-table-column
                            label="商家设置库存"
                            align="center"
                        >
                            <template slot-scope="scope">
                                <el-form-item style="margin-bottom: 20px">
                                    {{ scope.row.product_stock }}
                                </el-form-item>
                            </template>
                        </el-table-column>
                        <el-table-column label="邀请助力库存">
                            <template slot-scope="scope">
                                <el-form-item
                                    :prop="`price_list[${scope.$index}]`"
                                    :rules="rules.product.help_shopping_limit"
                                    style="margin-bottom: 20px"
                                >
                                    <el-input
                                        v-model="scope.row.help_shopping_limit"
                                        placeholder="请输入邀请助力库存"
                                        size="medium"
                                        style="width: 166px"
                                        :disabled="scope.row.check_status === 0"
                                        @click.native="clickDisableInput(scope.row)"
                                    />
                                </el-form-item>
                            </template>
                        </el-table-column>
                        <el-table-column label="免费领库存">
                            <template slot-scope="scope">
                                <el-form-item
                                    :prop="`price_list[${scope.$index}]`"
                                    :rules="rules.product.prerogative_limit"
                                    style="margin-bottom: 20px"
                                >
                                    <el-input
                                        v-model="scope.row.prerogative_limit"
                                        placeholder="请输入免费领库存"
                                        size="medium"
                                        style="width: 166px"
                                        :disabled="scope.row.check_status === 0"
                                        @click.native="clickDisableInput(scope.row)"
                                    />
                                </el-form-item>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-form-item>
                <el-form-item
                    label="优惠券编号"
                    v-if="ruleForm.type === '2'"
                >
                    <el-input
                        v-model="ruleForm.coupon_no"
                        size="medium"
                        disabled
                        style="width: 284px"
                    />
                </el-form-item>
                <el-form-item
                    label="红包编号"
                    v-if="ruleForm.type === '3'"
                >
                    <el-input
                        v-model="ruleForm.packet_no"
                        size="medium"
                        disabled
                        style="width: 284px"
                    />
                </el-form-item>
                <el-form-item :label="ruleForm.type === '1' ? '助力商品标题' : ruleForm.type === '2' ? '助力优惠券标题' : '助力红包标题'">
                    <el-input
                        v-model="ruleForm.title"
                        placeholder="邀请助力的活动标题"
                        size="medium"
                        clearable
                        style="width: 284px"
                    />
                    <span class="tips">*用于在邀请助力页面显示的{{ ruleForm.type === '1' ? '商品标题' : ruleForm.type === '2' ? '优惠券标题' : '红包标题' }}</span>
                </el-form-item>
                <el-form-item
                    label="排序号"
                    prop="sort"
                >
                    <el-input
                        oninput="value = value.replace(/[^\d]/g,'')"
                        v-model.number="ruleForm.sort"
                        placeholder="请输入排序号"
                        size="medium"
                        clearable
                        style="width: 284px"
                    />
                    <span class="tips">*越小越靠前</span>
                </el-form-item>
                <el-form-item
                    label="允许助力次数"
                    prop="help_shopping_limit"
                >
                    <el-input
                        v-model="ruleForm.help_shopping_limit"
                        placeholder="请输入助力次数"
                        size="medium"
                        clearable
                        style="width: 284px"
                    >
                        <span
                            slot="suffix"
                            style="margin-right: 6px"
                        >次</span>
                    </el-input>
                    <span class="tips">*商品允许发起助力的次数</span>
                </el-form-item>
                <el-form-item
                    label="允许免费领数量"
                    prop="prerogative_limit"
                >
                    <el-input
                        v-model="ruleForm.prerogative_limit"
                        size="medium"
                        placeholder="请输入免费领数量"
                        clearable
                        style="width: 284px"
                    >
                        <span
                            slot="suffix"
                            style="margin-right: 6px"
                        >个</span>
                    </el-input>
                    <span class="tips">*即不通过助力，可以直接领取的数量</span>
                </el-form-item>
                <el-form-item
                    label="助力人数"
                    prop="require_help_count"
                >
                    <el-input
                        v-model="ruleForm.require_help_count"
                        size="medium"
                        placeholder="请输入助力人数"
                        clearable
                        style="width: 284px"
                    >
                        <span
                            slot="suffix"
                            style="margin-right: 6px"
                        >人</span>
                    </el-input>
                    <span class="tips">*助力成功所需要帮忙助力的人数</span>
                </el-form-item>
            </el-form>
            <!--/表单-->

            <div class="btn-group">
                <el-button
                    size="medium"
                    style="width: 120px"
                    @click="handleCancel()"
                >
                    取消
                </el-button>
                <el-button
                    size="medium"
                    type="primary"
                    style="width: 120px"
                    :loading="loading"
                    @click="handleSubmit()"
                >
                    完成
                </el-button>
            </div>
        </div>

        <red-packet-select
            ref="packetSelect"
            @emit="emitRedPacketData"
        />
        <!-- 选择优惠券 -->
        <coupon-select
            ref="couponSelect"
            @emit="emitCouponData"
        />
        <!--商品选择弹窗-->
        <goods-select
            ref="goodsSelect"
            @change="handleSelectGoods"
        />
        <!-- 图片预览 -->
        <img-preview ref="preview"/>
    </div>
</template>

<script>
/**
 * 页面接收参数
 * @param no - 商品编号
 */

import {back} from '@/mixin/back';
import GoodsSelect from '@/components/goods/goods-select';
import imgPreview from '@/components/common/img-preview';
import couponSelect from '@/components/coupon/coupon-select.vue';
import redPacketSelect from '@/components/coupon/packet-select.vue';
const numberReg = /(?:^[1-9]([0-9]+)?(?:\.[0-9]{1,2})?$)|(?:^(?:0)$)|(?:^[0-9]\.[0-9](?:[0-9])?$)/;
const intReg = /^(0|[1-9][0-9]*|-[1-9][0-9]*)$/;
const typeMap = new Map([
    [1, 'goods_no'],
    [2, 'coupon_no'],
    [3, 'packet_no'],
]);

export default {
    name: "InvitationHelpEdit",
    data() {
        const validateHelpLimit = (rule, value, callback) => {
            if(value.check_status && !value.help_shopping_limit) {
                callback(new Error('邀请助力库存不能为空'));
            } else if(value.help_shopping_limit && !intReg.test(value.help_shopping_limit)) {
                callback(new Error('邀请助力库存必须为整数'));
            } else {
                callback();
            }
        };
        const validatePrerogativeLimit = (rule, value, callback) => {
            if(value.check_status && value.prerogative_limit === '') {
                callback(new Error('免费领库存不能为空'));
            } else if(value.prerogative_limit !== '' && !intReg.test(value.prerogative_limit)) {
                callback(new Error('免费领库存必须为整数'));
            } else {
                callback();
            }
        };

        return {
            ruleForm: {
                // 1商品 2优惠券 3红包
                type: '1',
                // 排期编号
                time_no: '',
                // 编辑时助力编号
                help_no: '',
                // 商品编号
                goods_no: '',
                // 优惠券编号
                coupon_no: '',
                // 红包编号
                packet_no: '',
                // 助力标题
                title: '',
                // 排序号
                sort: 99,
                // 规格价格列表
                price_list: [],
                // 可邀请助力次数
                help_shopping_limit: '',
                // 可无需邀请助力次数
                prerogative_limit: '',
                // 助力成功需求次数
                require_help_count: '',
            },
            // 商品原标题
            goods_title: '',
            // 商品原价
            goods_price: '',
            // 封面图
            goods_cover: '',
            // 校验规则
            rules: {
                goods_no: [
                    {required: true, message: '请选择商品', trigger: 'blur'}
                ],
                coupon_no: [
                    {required: true, message: '请选择优惠券', trigger: 'blur'}
                ],
                goods_title: [
                    {required: true, message: '商品标题不能为空', trigger: 'blur'}
                ],
                sort: [
                    {required: true, message: '排序号不能为空', trigger: 'blur'},
                    {pattern: intReg, message: '排序号必须为整数', trigger: 'blur'}
                ],
                help_shopping_limit: [
                    {required: true, message: '邀请助力库存不能为空', trigger: 'blur'},
                    {pattern: intReg, message: '邀请助力库存必须为整数', trigger: 'blur'}
                ],
                prerogative_limit: [
                    {required: true, message: '免费领库存不能为空', trigger: 'blur'},
                    {pattern: intReg, message: '免费领库存必须为整数', trigger: 'blur'}
                ],
                require_help_count: [
                    {required: true, message: '助力人数不能为空', trigger: 'blur'},
                    {pattern: intReg, message: '助力人数必须为整数', trigger: 'blur'}
                ],
                product: {
                    help_shopping_limit: [
                        {validator: validateHelpLimit, trigger: 'blur'},
                    ],
                    prerogative_limit: [
                        {validator: validatePrerogativeLimit, trigger: 'blur'},
                    ],
                }
            },
            loading: false,
            type: 'add',
            // 商品弹窗类型
            typeList: [
                {label: '自营', value: 1},
            ],
            requestUrl: '',
        };
    },
    mixins: [back],
    components: {
        GoodsSelect,
        couponSelect,
        imgPreview,
        redPacketSelect
    },
    mounted() {
        let query = this.$route.query;

        this.$store.commit('SET_HEADER', [{title: "APP后台"}, {title: '商城'}, {
            title: '邀请助力',
            path: '/student/invitation-help-list'
        }, {title: query.type === 'add' ? '添加商品/优惠券' : '编辑商品/优惠券'}]);
        this.type = query.type;
        this.ruleForm.time_no = query.time_no;
        if (query.no) {
            this.ruleForm.help_no = query.no;
            this.getDetail();
        }
    },
    filters: {
        filterSpec (val) {
            if(!val) return '';
            let str = '';

            val.forEach(el => {
                str += el.spec_name + ':' + el.spec_value + '；';
            });
            return str;
        }
    },
    methods: {
        /**
         * 获取选择的商品
         * @param val
         */
        handleSelectGoods(val) {
            this.ruleForm.goods_no = val.goods_no;
            this.goods_title = val.goods_title;
            this.goods_price = val.goods_price;
            this.goods_cover = val.goods_cover;
            val.product_list.forEach(item => {
                this.$set(item, 'check_status', 1);
                this.$set(item, 'price', 0.01);
                this.$set(item, 'prerogative_limit', 0);
            });
            this.ruleForm.price_list = val.product_list;
        },
        /**
         * 查看图片
         * @param   {String}    images      //单图预览
         * @param   {Array}     images      //多图预览
         */
        fnShowPreview(images) {
            if (images && Object.prototype.toString.call(images) == '[object String]') {
                this.$refs.preview.show([
                    images
                ]);
            } else if (images && Object.prototype.toString.call(images) == '[object Array]') {
                this.$refs.preview.show(images);
            } else {
                this.$message({
                    type: 'warning',
                    message: '图片类型错误'
                });
            }
        },

        /**
         * 提交
         */
        handleSubmit() {
            this.$refs.ruleForm.validate((valid) => {
                if (valid) {
                    this.loading = true;
                    let params = {...this.ruleForm};
                    let url = params.help_no ? '/student/shop_goods_help_shopping%5Cset' : '/student/shop_goods_help_shopping%5Cadd';

                    let price_list = params.price_list.filter((item, i) => {
                        return item.check_status !== 0;
                    });

                    params.price_list.forEach(item => {
                        if(item.price === '') {
                            item.price = 0.01;
                        }
                    });
                    params.product_json = JSON.stringify(price_list);
                    delete params.price_list;
                    params.type = Number(params.type);
                    params.aim_no = params[typeMap.get(params.type)];

                    this.$post(url, params, resp => {
                        if (resp.code === 1) {
                            this.$notify({
                                title: '提示',
                                message: '保存成功',
                                type: 'success',
                            });
                            setTimeout(() => {
                                this.handleRoute('invitationHelpList', {tab: this.$route.query.tab});
                            }, 500);
                        } else {
                            this.$notify({
                                title: '提示',
                                message: resp.msg,
                                type: 'warning'
                            });
                        }
                        this.loading = false;
                    });

                }
            });
        },

        /**
         * 返回列表
         */
        handleCancel() {
            this.$confirm('返回后将不会保存您所修改的内容,是否返回?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                this.handleRoute('invitationHelpList', {tab: this.$route.query.tab});
            });
        },

        /**
         * 编辑时获取详情
         */
        getDetail() {
            let params = {
                help_no: this.ruleForm.help_no
            };

            this.$post('/student/shop_goods_help_shopping%5Cget', params, resp => {
                if (resp.code === 1) {
                    this.ruleForm[typeMap.get(resp.data.type)] = resp.data.aim_no;
                    this.ruleForm.type = String(resp.data.type);
                    this.ruleForm.title = resp.data.title;
                    this.ruleForm.require_help_count = resp.data.require_help_count;
                    this.ruleForm.prerogative_limit = resp.data.prerogative_limit;
                    this.ruleForm.help_shopping_limit = resp.data.help_shopping_limit;
                    this.ruleForm.sort = resp.data.sort;

                    resp.data.product_info.forEach(item => {
                        item.check_status = 1;
                    });
                    this.ruleForm.price_list = resp.data.product_info;
                    this.getProductList();
                } else {
                    this.$notify({
                        title: '提示',
                        message: resp.msg,
                        duration: 2000,
                        type: 'warning'
                    });
                }
            });
        },

        /**
         * 详情时获取产品规格信息
         */
        getProductList() {
            let params = {
                goods_nos: this.ruleForm.goods_no,
            };

            this.$post('/student/shop_goods%5Cget_list_for_select', params, resp => {
                if (resp.code === 1) {
                    let data = resp.data.list[0];

                    this.goods_title = data.goods_title;
                    this.goods_price = data.goods_price;
                    this.goods_cover = data.goods_cover;
                    data.product_list.map(item => {
                        this.$set(item, 'check_status', 0);
                        this.$set(item, 'price', 0.01);
                        this.$set(item, 'prerogative_limit', 0);
                        this.ruleForm.price_list.map(option => {
                            if(item.product_no === option.product_no) {
                                this.$set(item, 'check_status', 1);
                                this.$set(item, 'price', option.price);
                                this.$set(item, 'prerogative_limit', option.prerogative_limit);
                                this.$set(item, 'help_shopping_limit', option.help_shopping_limit);
                            }
                        });
                    });
                    this.ruleForm.price_list = data.product_list;
                } else {
                    this.$notify({
                        title: '提示',
                        message: resp.msg,
                        type: 'warning'
                    });
                }
            });
        },

        /**
         * 获取优惠券
         * @param val
         */
        emitCouponData(val) {
            let data = val.list[0];

            this.$refs.couponSelect.close();
            this.ruleForm.coupon_no = data.coupon_no;
        },

        /**
         * 获取红包
         * @param val
         */
        emitRedPacketData(val) {
            let data = val.list[0];

            this.$refs.packetSelect.close();
            this.ruleForm.packet_no = data.packet_no;
        },

        /**
         * @description 过滤函数
         */
        emptyFormatter(row, column, val) {
            if (!val) return '--';
            return val;
        },

        /**
         * 点击禁用的input
         * @param row
         */
        clickDisableInput(row) {
            if(!row.check_status) {
                this.$message.warning('请勾选该规格');
            }
        },

        /**
         * 路由跳转
         * @param routeName
         * @param query
         */
        handleRoute(routeName, query) {
            this.$router.push({
                name: routeName,
                query
            });
        },

        /**
         * 全选
         * @param selection
         */
        handleSelectAll(selection) {
            this.ruleForm.price_list.forEach(item => {
                this.$set(item, 'check_status', selection.length ? 1 : 0);
            });
        },
    }
};
</script>

<style scoped lang="less">
.wrapper {
    width: 100%;

    .content-wrapper {
        display: flex;
        height: calc(100% - 24px);
        flex-direction: column;
        position: relative;
        margin: 12px;
        background: #fff;
        box-sizing: border-box;
        overflow-y: auto;
        &::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }

        /*header*/

        .header {
            height: 68px;
            padding: 24px;
            box-sizing: border-box;
            box-shadow: 0px -1px 0px 0px #F0F2F5;
            display: flex;
            align-items: center;
            justify-content: space-between;

            .header-title {
                color: #333333;
                font-size: 20px;
                height: 20px;
                font-weight: 500;
                position: relative;
                margin: 24px 0 24px 12px;

                &::before {
                    content: '';
                    position: absolute;
                    left: -8px;
                    top: -1px;
                    width: 3px;
                    height: 20px;
                    background: #1890FF;
                }
            }
        }

        /*表单*/

        .form-wrap {
            padding: 24px 32px;
            .select-goods-view {
                display: flex;
                height: 112px;
                .select-goods {
                    width: 112px;
                    height: 112px;
                    background: #FFFFFF;
                    border-radius: 4px;
                    border: 1px solid #20A0FF;
                    display: flex;
                    flex-direction: column;
                    justify-content: center;
                    align-items: center;
                    font-size: 14px;
                    font-family: PingFangSC-Medium, PingFang SC;
                    font-weight: 500;
                    color: #20A0FF;
                    cursor: pointer;
                    margin-right: 24px;
                    i {
                        font-size: 30px;
                    }
                    &.detail {
                        border: 0;
                    }
                    &.selected {
                        border: 0;
                        position: relative;
                        &:hover {
                            &::after {
                                content: "";
                                position: absolute;
                                width: 112px;
                                height: 112px;
                                background: rgba(0, 0, 0, 0.6);
                                border-radius: 4px;
                                left: 0;
                                top: 0;
                                display: flex;
                            }
                            &::before {
                                content: "重新选择";
                                position: absolute;
                                width: 88px;
                                height: 32px;
                                border-radius: 18px;
                                border: 1px solid #FFFFFF;
                                z-index: 1;
                                display: flex;
                                align-items: center;
                                justify-content: center;
                                font-size: 14px;
                                font-family: PingFangSC-Medium, PingFang SC;
                                font-weight: 500;
                                color: #FFFFFF;
                            }
                        }
                    }
                }
                .select-goods-info {
                    height: 100%;
                    display: flex;
                    flex-direction: column;
                    justify-content: center;
                    .goods-info-item {
                        display: flex;
                        font-size: 14px;
                        font-family: PingFangSC-Regular, PingFang SC;
                        font-weight: 400;
                        color: #555555;
                        .goods-info__value {
                            color: #999999;
                        }
                    }
                }
            }
            .select-btn {
                width: 130px;
                height: 36px;
                background: #FFFFFF;
                border-radius: 4px;
                border: 1px solid #1890FF;
                font-size: 14px;
                font-family: PingFangSC-Regular, PingFang SC;
                font-weight: 400;
                color: #1890FF;
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
            }


            .zd-spec {
                display: flex;
                font-size: 14px;
                padding-right: 12px;

                .zd-spec-luck-text {
                    margin-right: 10px;
                }
            }

            /deep/ .el-checkbox-group {
                display: flex;
                flex-direction: column;

                .zd-spec {
                    display: flex;
                    overflow: hidden;
                    white-space: nowrap;
                    text-overflow: ellipsis;

                    .zd-spec-text {
                        font-size: 14px;
                        margin-right: 10px;
                    }
                }

                .el-checkbox {
                    width: min-content;
                }
            }

            .tips {
                margin-left: 12px;
                font-size: 12px;
                font-family: PingFangSC-Regular, PingFang SC;
                font-weight: 400;
                color: #999999;
            }

            .el-radio-group-wrap {
                display: flex;
                flex-direction: column;
                margin-top: 12px;

                .el-radio {
                    display: flex;
                }
            }
        }

        .btn-group {
            margin-left: 120px;
            padding-bottom: 36px;

            .el-button {
                margin: 0 24px;
            }
        }
    }

    /*el-tabs*/

    /deep/ .el-tabs {
        margin-top: -12px;
        .el-tabs__nav-wrap {
            height: 54px;
            padding-left: 24px;

            .el-tabs__nav-scroll {
                .el-tabs__nav {
                    height: 54px;
                    line-height: 54px;
                }
            }
        }
    }
    /deep/ .el-table {
        width: 100%;
        border: 1px solid #eee;
        th {
            background: #f2f2f2!important;
        }
        td {
            border-bottom: 0!important;
            background: #FBFBFB!important;
        }
    }
    /deep/ .el-table.product {
        background: #FBFBFB!important;
        .el-table__body-wrapper {
            padding-top: 12px;
        }
    }
}
</style>
